吧<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>后台登陆</title>
  <link rel="stylesheet" href="css/login.css">
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/index.js"></script>
  <script src="./lib/layui/layui.js" charset="utf-8"></script>
</head>
<body class="login-bg">
    <canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
    <div class="login">
        <div class="message">后台登录</div>
        <div id="darkbannerwrap"></div>   
        <form method="post" class="layui-form" onsubmit="return false;">
            <input name="uloginname" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="upassword" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>
    <script>
    layui.use(['form','table','layer'],function(){
		var  form=layui.form;
		var  table=layui.table;
		var   layer=layui.layer;
		var  $=layui.$;
		form.on('submit(login)', function(data){
			
		$.ajax({
		  		type:'get',
		  		url:'loginn',
		  		data:data.field,
		  		dataType:'json',
		  		success:function(res){
					if(res.res=='1'){
						layer.msg("账户已被锁定，请尝试别的账户！")
					}else if(res.res=='3'){
						layer.msg("用户名或密码错误，请重新输入！")
					}else if(res.res=='2'){
						
								var   rolesName=[];
								for(var i=0;i<res.rolesName.length;i++){
									rolesName.push(res.rolesName[i].roleid);
								}
						location.href="index.html";
					}
		  		}
		  	})
		  return false;
		});
		
	})
        </script>

    
    <!-- 底部结束 -->
    
</body>
</html>